class People {
  constructor(name) {
    this.name = name;
  }

  sayName() {
    console.log(`My name is ${this.name}`);
  }
}

class Student extends People {
  constructor(name, studyNum) {
    super(name);
    this.studyNum = studyNum;
  }

  sayHi() {
    console.log(`Hi, my name is ${this.name}, my studyNum is ${this.studyNum}`);
  }
}

function isVowel(str) {
  if (typeof str !== 'string') {
    console.log(`${str} type is not string, please input a string.`);
    return;
  }
  const lastCharacter = str.toString().slice(str.length - 1);
  const vowelRegex = /[a,e,i,o,u]/i;

  if (vowelRegex.test(lastCharacter)) {
    return true;
  } else {
    return false;
  }
}
var tools = {
  isVowel: function isVowel(str) {
    if (typeof str !== 'string') {
      console.log(`${str} type is not string, please input a string.`);
      return;
    }
    const lastCharacter = str.toString().slice(str.length - 1);
    const vowelRegex = /[a,e,i,o,u]/i;

    if (vowelRegex.test(lastCharacter)) {
      return true;
    } else {
      return false;
    }
  },
};
